﻿//********************************************************************************//
//创建日期：<创建日期，2016-03-14>
//创建作者：<郭登杰，guodengjie@shanghai3h.com>
//功能说明：发票领用Model
//********************************************************************************//
using System;
using System.Collections.Generic;
using YXYLCommon;
using System.Data;

namespace Entity
{
    [Serializable]
    /// <summary>
    /// 发票库存
    /// </summary>
    public class YSZWFaPiaoLY : BaseModel
    {
        public YSZWFaPiaoLY()
        {
        }

        public int I_XT { get; set; }

        public int ID { get; set; }

        public int I_JLZT { get; set; }

        public int I_LINGYONGSL { get; set; }

        public int I_FAPIAOKCID { get; set; }

        public string S_ZHANDIANBH { get; set; }

        public string S_ZHANDIANMC { get; set; }

        public string S_GUANLIKBH { get; set; }

        public string S_GUANLIKMC { get; set; }

        public string S_LINGYONGQSHM { get; set; }

        public string S_LINGYONGJSHM { get; set; }

        public string S_LINGYONGR { get; set; }

        public DbDateTime D_LINGYONGRQ { get; set; }

        public string S_CAOZUOR { get; set; }
        public string S_CAOZUORMC { get; set; }

        public DbDateTime D_CAOZUORQ { get; set; }

        public int I_SHIYONGSL { get; set; }

        public int I_SHENGYUSL { get; set; }

        public string S_SHENGYUQSHM { get; set; }

        public override BaseModel ToObject(System.Data.DataRow row)
        {
            this.IsExists = true;
            this.I_XT = Convert.ToInt32(row["I_XT"]);
            this.ID =Convert.ToInt32(row["ID"]);
            this.I_JLZT = Convert.ToInt32(row["I_JLZT"]);
            this.I_LINGYONGSL = Convert.ToInt32(row["I_LINGYONGSL"]);
            this.I_FAPIAOKCID = Convert.ToInt32(row["I_FAPIAOKCID"]);
            this.S_ZHANDIANBH = Convert.ToString(row["S_ZHANDIANBH"]);
            this.S_ZHANDIANMC = Convert.ToString(row["S_ZHANDIANMC"]);
            this.S_GUANLIKBH = Convert.ToString(row["S_GUANLIKBH"]);
            this.S_GUANLIKMC = Convert.ToString(row["S_GUANLIKMC"]);
            this.S_LINGYONGQSHM = Convert.ToString(row["S_LINGYONGQSHM"]);
            this.S_LINGYONGJSHM = Convert.ToString(row["S_LINGYONGJSHM"]);
            this.S_LINGYONGR = Convert.ToString(row["S_LINGYONGR"]);
            this.D_LINGYONGRQ = DbDateTime.Parse(row["D_LINGYONGRQ"]);
            this.S_CAOZUOR = Convert.ToString(row["S_CAOZUOR"]);
            this.S_CAOZUORMC = Convert.ToString(row["S_CAOZUORMC"]);
            this.D_CAOZUORQ = DbDateTime.Parse(row["D_CAOZUORQ"]);
            this.I_SHIYONGSL = Convert.ToInt32(row["I_SHIYONGSL"]);
            this.I_SHENGYUSL = Convert.ToInt32(row["I_SHENGYUSL"]);
            this.S_SHENGYUQSHM = Convert.ToString(row["S_SHENGYUQSHM"]);
            return this;
        }
    }
    public class DALYSZWFaPiaoLY : BaseDAL
    {
        public DALYSZWFaPiaoLY()
        {

        }
        protected override void fillSaveProc(BaseModel model)
        {
            //YS_ZW_FAPIAOKC obj = (YS_ZW_FAPIAOKC)model;
        }


        public DbCmdResult Save(YS_ZW_FAPIAOKC obj)
        {
            //dbProc.Init("P_YSZW_FAPIAORK");
            return CommonService.Ini().ExcuteProcOracle(dbProc);
        }

        public List<YSZWFaPiaoLY> Get(int xt,string zhandian,string guanlik)
        {
            dbProc.Init("P_YSZW_FAPIAOLYJL");
            dbProc.AddParameter("V_XT", xt);
            dbProc.AddParameter("V_ZHANDIANBH", zhandian);
            dbProc.AddParameter("V_GUANLIKBH", guanlik);
            return CommonService.Ini().GetList<YSZWFaPiaoLY>(dbProc);
        }
    }

}